import pymysql

from mine.DBUtils import database

from pymysql import *

userr = "zhangjie"
upassword = "root"

host = "127.0.0.1"
user = "root"
password = "root"
database = "duxiaoman"

db = pymysql.connect(host=host, user=user, password=password, database=database)
cursor = db.cursor()
sql = "select * from IOcount"
cursor.execute(sql)
data = cursor.fetchall()

for i in range(0,3):
    users = input("请输入账号")
    passwd = input("请输入密码")
    if users == userr and passwd == upassword:
        for roll in data:
            print(roll)
        break
    elif i == 2:
        print("错误输入三次，已锁定。")
    else:
        print("账号密码有误，请重新输入！")

cursor.close()
db.close()








